//
//  NSString+WJStringExt.m
//  weibo
//
//  Created by 王俊 on 16/1/3.
//  Copyright © 2016年 王俊. All rights reserved.
//

#import "NSString+WJStringExt.h"

@implementation NSString (WJStringExt)

+ (instancetype)getFilePathWithName:(NSString*)name
{
    NSString *docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true)lastObject];
    NSString *path = [docPath stringByAppendingPathComponent:name];
    return path;
}
- (instancetype)appendDocumentDir
{
    NSString *docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true)lastObject];
    NSString *path = [docPath stringByAppendingPathComponent:self];
    return path;
}
- (instancetype)appendCacheDir
{
    NSString *docPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, true)lastObject];
    NSString *path = [docPath stringByAppendingPathComponent:self];
    return path;
}
- (instancetype)appendTempDir
{
    NSString *docPath = NSTemporaryDirectory();
    NSString *path = [docPath stringByAppendingPathComponent:self];
    return path;
}
@end
